bool isPalindrome(struct ListNode* head){
    int a[200000];
    int i=0;
    struct ListNode *p=head;
    while(p)
    {
        a[i++] = p->val;
        p=p->next;
    }    
    int b=0,s= i-1;
    while(b<s)
    {
        if(a[b]!=a[s]) return false;
        else
        {
            b++;
            s--;
        }
    }
    return true;
}
